<template>
    <keep-alive>
        <router-view :key="key" />
    </keep-alive>
</template>

<script>
export default {
    computed: {
        key () {
            if (this.$route.query.cache) {
                return this.cacheRoute;
            } else {
                return this.notCacheRoute;
            }
        },

        cacheRoute () {
            return this.$route.path;
        },

        notCacheRoute () {
            return this.$route.fullPath;
        }
    }
};
</script>
